<?php 
	include('check_session.php');	
	require('conexao.class.php');
	
	$db = new Conexao();
	$conexao = $db->open();
	
	if (isset($_GET['id']) && !empty($_GET['id'])) {
		$result = pg_query($conexao, "Select * from conta_contabils where id = {$_GET['id']}");
		if (!$result) {
			echo "Ocorreu um erro na consulta dos dados.";
			exit;
		}
		
		$dataContas = array();
		$dataContas = pg_fetch_array($result);
	}
	
	$db->close();
	
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />	
	<title>Lista de Contas</title>
	<link rel="stylesheet" type="text/css" href="css/bootstrap.css" /><link rel="stylesheet" type="text/css" href="/sidep/css/bootstrap-responsive.css" />
	<link rel="stylesheet" type="text/css" href="css/bootstrap-custom.css" /><link rel="stylesheet" type="text/css" href="/sidep/css/bootstrap-responsive-custom.css" />
	<link rel="stylesheet" type="text/css" href="css/sidep.css" /><script type="text/javascript" src="/sidep/js/jquery-1.7.2.js"></script>	
</head>
<body>
	<br/>
	<div class="container">
    	<div class="row">
			<div class="page">

				<div class="page-header">
					<h2>Visualizar Conta Contábil</h2>
					<div class="page-header-fields">
						<a href="#" class="btn btn-primary"><i class="icon-user icon-white"></i> Boa noite, Sr(a). <?php echo $_SESSION['usuario']['nome']; ?></a>					
						<a href="lista.php" class="btn btn-primary"><i class="icon-th-list icon-white"></i> Listar Contas</a>
						<a href="logout.php" class="btn btn-danger"><i class="icon-off icon-white"></i>Sair</a>								
					</div>
				</div>

				<div class="page-content">	
					<table class="table table-bordered table-striped">
						<tbody>
							<tr>
								<td><h5>Código</h5></td>
								<td><?php echo $dataContas['id']; ?>&nbsp;</td>
							</tr>
							<tr>
								<td><h5>Descrição</h5></td>
								<td><?php echo $dataContas['descricao']; ?>&nbsp;</td>
							</tr>
							<tr>
								<td><h5>Vida Útil</h5></td>
								<td><?php echo $dataContas['vida_util']; ?>&nbsp;</td>
							</tr>
							<tr>
								<td><h5>Taxa Residual</h5></td>
								<td><?php echo $dataContas['taxa_residual']; ?>&nbsp;</td>
							</tr>
						</tbody>
					</table>
				</div>

   				<div class="page-footer"></div>

			</div>
		
		</div><!--/row-->

    </div><!--/.fluid-container-->
	</body>
</html>
